/**
 * Created by wyy on 17-7-6.
 */
angular.module('navBar',[]).component(
    'navBar',
    {
        templateUrl: 'component/base/navBar/nav_bar.template.html',
        controller: ['$rootScope', '$scope', 'Api','$stateParams', 'Enum', '$state', 'CompanyModel', 'ApartmentInfoModel',function ($rootScope, $scope, Api, $stateParams,Enum, $state, CompanyModel,ApartmentInfoModel) {


            // setupNavSelectedWithState($state.current.name);

            getCompanyDetail();

            $scope.bindSignOutModule = bindSignOutModule;



            function bindSignOutModule() {
                window.localStorage.clear();

                window.location.href = '/tribalc-web-apartment/login.html';

            }
            function getCompanyDetail() {
                // if(!Api.getAssign()){
                //     return false;
                // }
                Api.getCompanyDetail(Api.getAssign(), function (result) {
                    // console.log(result)
                    var company = new CompanyModel(result.data);
                    $rootScope.RootCompanyInfo = company;
                    $scope.companyName = company.companyName;
                    $scope.companyLogo = company.logo;
                });
            }



        }]



    }

);
